package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionSuperviseMapper;
import com.ruoyi.net.domain.ElementQosActionSupervise;
import com.ruoyi.net.service.IElementQosActionSuperviseService;

/**
 * 网元-QOS配置-流行为-流量监管Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionSuperviseServiceImpl implements IElementQosActionSuperviseService 
{
    @Autowired
    private ElementQosActionSuperviseMapper elementQosActionSuperviseMapper;

    /**
     * 查询网元-QOS配置-流行为-流量监管
     * 
     * @param id 网元-QOS配置-流行为-流量监管主键
     * @return 网元-QOS配置-流行为-流量监管
     */
    @Override
    public ElementQosActionSupervise selectElementQosActionSuperviseById(String id)
    {
        return elementQosActionSuperviseMapper.selectElementQosActionSuperviseById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-流量监管列表
     * 
     * @param elementQosActionSupervise 网元-QOS配置-流行为-流量监管
     * @return 网元-QOS配置-流行为-流量监管
     */
    @Override
    public List<ElementQosActionSupervise> selectElementQosActionSuperviseList(ElementQosActionSupervise elementQosActionSupervise)
    {
        return elementQosActionSuperviseMapper.selectElementQosActionSuperviseList(elementQosActionSupervise);
    }

    /**
     * 新增网元-QOS配置-流行为-流量监管
     * 
     * @param elementQosActionSupervise 网元-QOS配置-流行为-流量监管
     * @return 结果
     */
    @Override
    public int insertElementQosActionSupervise(ElementQosActionSupervise elementQosActionSupervise)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionSupervise.getId())) {
            elementQosActionSupervise.setId(uuid);
        }
        elementQosActionSupervise.setCreateBy(SecurityUtils.getUsername());
        elementQosActionSupervise.setCreateTime(DateUtils.getNowDate());
        elementQosActionSupervise.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionSupervise.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionSuperviseMapper.insertElementQosActionSupervise(elementQosActionSupervise);
    }

    /**
     * 修改网元-QOS配置-流行为-流量监管
     * 
     * @param elementQosActionSupervise 网元-QOS配置-流行为-流量监管
     * @return 结果
     */
    @Override
    public int updateElementQosActionSupervise(ElementQosActionSupervise elementQosActionSupervise)
    {
        elementQosActionSupervise.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionSupervise.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionSuperviseMapper.updateElementQosActionSupervise(elementQosActionSupervise);
    }

    /**
     * 批量删除网元-QOS配置-流行为-流量监管
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-流量监管主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionSuperviseByIds(String[] ids)
    {
        return elementQosActionSuperviseMapper.deleteElementQosActionSuperviseByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-流量监管信息
     * 
     * @param id 网元-QOS配置-流行为-流量监管主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionSuperviseById(String id)
    {
        return elementQosActionSuperviseMapper.deleteElementQosActionSuperviseById(id);
    }
}
